/****************************************************************************
 * Copyright (c) 2021 Qualcomm Technologies International, Ltd
****************************************************************************/
/**
 * \file  ml_nnops_cap.h
 * \ingroup capabilities
 *
 * ML_NNOPS Capability public header file. <br>
 *
 */

#ifndef ML_NNOPS_CAP_H
#define ML_NNOPS_CAP_H

/****************************************************************************
Include Files
*/
#include "capabilities.h"
#include "ml_nnops_layer.h"

/* Maximum number of input terminal supported by the capability */
#define MAX_IP_TERMINALS 1
/* Maximum number of output terminal supported by the capability */
#define MAX_OP_TERMINALS 1

/* Number of samples required for the capability to start
 * processing. This also decides the size of the ip_buffer */
#define INPUT_FRAME_SIZE 160

/* Number of samples generated by the capability post
 * execution. This also decides the size of the op_buffer */
#define OUTPUT_FRAME_SIZE 160

#define ML_NNOPS_POINT_FIVE_IN_Q31   0x40000000

/* Capability specific data strcture for ML_NNOPS capability */
typedef struct ML_NNOPS_OP_DATA
{
    /* Buffer at the input terminal of the capability */
    tCbuffer *ip_buffer;
    /* Buffer at the output terminal of the capability */
    tCbuffer *op_buffer;
    /* Head of the ml_nnops_layer linked list*/
    ML_NNOPS_LAYER *ml_nnops_layer_head;
}ML_NNOPS_OP_DATA;

/* The capability data structure for ML_NNOPS capability */
extern const CAPABILITY_DATA ml_nnops_cap_data;

/* ML_NNOPS Data Processing Function */
extern void ml_nnops_process_data(OPERATOR_DATA*, TOUCHED_TERMINALS*);

/* Capability Function Handlers */
extern bool ml_nnops_op_create(OPERATOR_DATA *op_data, void *message_data,
                               unsigned *response_id, void **response_data);
extern bool ml_nnops_op_destroy(OPERATOR_DATA *op_data, void *message_data,
                               unsigned *response_id, void **response_data);                               
extern bool ml_nnops_op_buffer_details(OPERATOR_DATA *op_data, void *message_data,
                                       unsigned *response_id, void **response_data);
extern bool ml_nnops_op_connect(OPERATOR_DATA *op_data, void *message_data,
                                unsigned *response_id, void **response_data);
#endif /* ML_NNOPS_CAP_H */
